home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "shared.fx"
- #include "lighting.fx"
- #define FOG_DISABLE
- #include "fog.fx"
-
- //------------------------------------------------------------------------------------------------------
- //- Static parameters
- //------------------------------------------------------------------------------------------------------
-
- texture DiffuseMap;
- float4 Color; //shared between all occurences of this shader.
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- struct GlowVertexShaderInput
- {
- float4 Position : POSITION;
- float2 DiffuseUv : TEXCOORD0;
- };
-
- //------------------------------------------------------------------------------------------------------
-
- struct GlowVertexShaderOutput
- {
- float4 Position : POSITION;
- float4 Color : COLOR0;
- float2 DiffuseUv : TEXCOORD0;
- FOG_OPTION_VERTEX_FIELD
- };
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- GlowVertexShaderOutput GlowVertexShaderTech1Pass1(const GlowVertexShaderInput input);
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- GlowVertexShaderOutput GlowVertexShaderTech1Pass1(const GlowVertexShaderInput input)
- {
- GlowVertexShaderOutput output;
-
- // output position into world+view+projection space
- output.Position = mul (input.Position,WorldCameraProjection);
-
- // Diffuse Uv output
- output.DiffuseUv = input.DiffuseUv;
-
- // use color0 to store the fade factor!!
- output.Color = Color;
-
- // fog computation
- FOG_OPTION_COMPUTE(output, output.Position);
-
- return output;
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- GlowVertexShaderOutput GlowVertexShaderTransformedPosition(const GlowVertexShaderInput input)
- {
- GlowVertexShaderOutput output;
-
- output.Position = mul(input.Position, World);
- output.DiffuseUv = input.DiffuseUv;
- output.Color.rgba = Color;
-
- return output;
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique Glow
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 0;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = CLAMP;
- AddressV[0] = CLAMP;
- CullMode = CW;
- ZEnable = false;//true;
- ZFunc = ALWAYS;
- ZWriteEnable = true;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = true; //use alpha blend !!! I beg thee.
- SrcBlend = ONE; // additive blend.
- DestBlend = ONE; // additive blend.
- FOG_OPTION_PARAMETERS;
-
- VertexShader = compile vs_1_1 GlowVertexShaderTech1Pass1();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul r0.rgb,t0,v0 + mul r0.a,v0.a,t0.a
- mul r0.rgb,r0,r0.a
- };
- }
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique GlowAlpha
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 1;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = CLAMP;
- AddressV[0] = CLAMP;
- CullMode = CW;
- ZEnable = false;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = true; //use alpha blend !!! I beg thee.
- SrcBlend = SRCALPHA;
- DestBlend = INVSRCALPHA;
- FOG_OPTION_PARAMETERS;
-
- VertexShader = compile vs_1_1 GlowVertexShaderTech1Pass1();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul r0.rgb, t0, v0 + mul r0.a, t0.a, v0.a
- };
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique GlowScreenSpaceAdditive
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 2;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = CLAMP;
- AddressV[0] = CLAMP;
- CullMode = NONE;
- ZEnable = false;
- ZFunc = ALWAYS;
- ZWriteEnable = false;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = true; //use alpha blend !!! I beg thee.
- SrcBlend = ONE; // additive blend.
- DestBlend = ONE; // additive blend.
- FOG_OPTION_PARAMETERS;
-
- VertexShader = compile vs_1_1 GlowVertexShaderTransformedPosition();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul r0.rgb,t0,v0 + mul r0.a,v0.a,t0.a
- mul r0.rgb,r0,r0.a
- };
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique GlowScreenSpaceAlpha
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 3;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = CLAMP;
- AddressV[0] = CLAMP;
- CullMode = CW;
- ZEnable = false;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = true; //use alpha blend !!! I beg thee.
- SrcBlend = SRCALPHA;
- DestBlend = INVSRCALPHA;
- FOG_OPTION_PARAMETERS;
-
- VertexShader = compile vs_1_1 GlowVertexShaderTransformedPosition();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul r0.rgb, t0, v0 + mul r0.a, t0.a, v0.a
- };
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique techTnL_0
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = TNL_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- WorldTransform[0] = <WorldCameraProjection>;
-
- Texture[0] = <DiffuseMap>;
-
- ColorArg1[0] = TEXTURE;
- ColorOp[0] = SELECTARG1;
- AlphaArg1[0] = TEXTURE;
- AlphaOp[0] = SELECTARG1;
-
- ColorOp[1] = DISABLE;
- AlphaOp[1] = DISABLE;
-
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
-
- AddressU[0] = WRAP;
- AddressV[0] = WRAP;
-
- CullMode = CW;
- ZEnable = false;
- ZFunc = ALWAYS;
- ZWriteEnable = true;
- AlphaBlendEnable = false;
- AlphaTestEnable = true;
- AlphaRef = 192;
- AlphaFunc = GREATEREQUAL;
-
- VertexShader = NULL;
- PixelShader = NULL;
- }
- }
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "mesh_shadow.fx"
- #include "mesh_shadow_projector.fx"
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
-